package tn.vermeg.jee.tweetVermeg2.main.presentation.model;


import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import tn.enit.jee.tweenit.Buisness.MainModule;
import tn.enit.jee.tweenit.model.Contact;


@Named(value = "loginModel")
@SessionScoped
public class LoginModel implements Serializable {
     static Contact contact;
    private MainModule mainModule;
    
    public Contact getContact() {
        return contact;
    }

    public void setContact(Contact contact) {
        this.contact = contact;
    }

    public MainModule getMainModule() {
        return mainModule;
    }

    public void setMainModule(MainModule mainModule) {
        this.mainModule = mainModule;
    }
    

    /**
     * Creates a new instance of LoginModel
     */
    public LoginModel() {
    }
    public void signIn(){
        mainModule.inscrire(contact);
    }
    public void connect(){
        mainModule.authenticate(contact.getEmail(), contact.getPassword());
    }
}
